<!-- php:$title = $cate_rs ? $cate_rs.title.' - '.$page_rs.title : $page_rs.title -->
<!-- include tpl=head title=$title menutitle=$page_rs.title -->
<div class="banner"{if $page_rs.banner} style="background-image:url('{$page_rs.banner.gd.auto}')"{/if}></div>
<script type="text/javascript">
$(document).ready(function(){
	$("#postform").submit(function(){
		if(!$("#title").val()){
			$.dialog.alert('请填写留言主题');
			return false;
		}
		if(!$("#fullname").val()){
			$.dialog.alert('请填写您的姓名');
			return false;
		}
		if(!$("#email").val() && !$("#mobile").val()){
			$.dialog.alert('请留下您的联系方式，邮箱或者手机');
			return false;
		}
		if(!$("#content").val()){
			$.dialog.alert('请填写您要咨询的内容');
			return false;
		}
		$(this).ajaxSubmit({
			'url':api_url('post','save'),
			'type':'post',
			'dataType':'json',
			'success':function(rs){
				if(rs.status == 'ok'){
					$.dialog.alert('感觉您提交的留言，我们会尽快处理您的留言',function(){
						$.phpok.reload();
					},'succeed');
				}else{
					$.dialog.alert(rs.content);
					return false;
				}
			}
		});
		return false;
	});
});
</script>
<div class="main clearfix">
	<div class="left">
		<!-- include tpl=block_contact -->
	</div>
	<div class="right">
		<div class="pfw">
			<div class="title">
				<h3>{$page_rs.title}</h3>
				<span class="breadcrumbs">
					您现在的位置：
					<a href="{$sys.url}" title="{$config.title}">首页</a>
					<span class="arrow">&gt;</span> <a href="{$page_rs.url}" title="{$page_rs.title}">{$page_rs.title}</a>
				</span>
			</div>
			<div class="message_post">
			<form method="post" class="form" id="postform">
			<input type="hidden" name="id" value="{$page_rs.identifier}" />
			<!-- php:$list = phpok('_fields','pid='.$page_rs.id.'&fields_format=1&in_title=1') -->
			<!-- loop from=$list key=$key value=$value id=$tmpid -->
			<div class="table clearfix" id="form_{$value.identifier}">
				<div class="l">{$value.title}：</div>
				<div class="r">{$value.html}</div>
			</div>
			<!-- /loop -->
			<!-- if $sys.is_vcode && function_exists('imagecreate') -->
			<div class="table clearfix" id="form_{$value.identifier}">
				<div class="l">验证码：</div>
				<div class="r">
					<input class="vcode"  type="text" name="_chkcode" id="_chkcode" />
					<img src="" border="0" align="absmiddle" id="vcode" class="hand" />
				</div>
			</div>
			<script type="text/javascript">
			$(document).ready(function(){
				$("#vcode").phpok_vcode();
				$("#vcode").click(function(){
					$(this).phpok_vcode();
				});
			});
			</script>
			<!-- /if -->
			<div class="table clearfix">
				<div class="l">&nbsp;</div>
				<div class="r"><input type="submit" value="提交" class="large button blue" /></div>
			</div>
			</form>
			</div>
		</div>
		<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
		<div class="pfw">
			<div class="title"><h3>{$value.title}</h3><span class="ext">{func time_format $value.dateline}</span></div>
			<div class="detail">
				<!-- if $value.content --><div class="content">{func nl2br $value.content}</div><!-- /if -->
				<!-- if $value.pictures -->
				<ul class="piclist">
					<!-- loop from=$value.pictures key=$k value=$v -->
					<li style="margin-right:10px;"><a href="{$v.gd.auto}" target="_blank"><img src="{$v.gd.thumb}" width="90" /></a></li>
					<!-- /loop -->
				</ul>
				<!-- /if -->
				<!-- if $value.adm_reply -->
				<fieldset><legend>管理员回复</legend>{$value.adm_reply}</fieldset>
				<!-- /if -->
			</div>
		</div>
		<!-- /loop -->
		<!-- include tpl=block_pagelist -->
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$(".thumb").mouseover(function(){
		var pid = $(this).attr('data-id');
		var thumb = $(this).attr('data');
		$("#product_"+pid).attr("src",thumb);
		$(".thumb[data-id="+pid+"]").removeClass("hover");
		$(this).addClass('hover');
	});
});
</script>
<!-- include tpl=foot -->